#include <QtGui>

#include "treefiles.h"

TreeFiles::TreeFiles(QWidget * parent) : QTreeWidget(parent)
{
    QStringList labels;
    labels << tr("File") << tr("Location");

    QTreeWidgetItem * root = new QTreeWidgetItem(this);
    root->setText(0, tr("root directory"));

    header()->setResizeMode(QHeaderView::Interactive);
    setHeaderLabels(labels);

    /* -- Spécification des icônes de l'arbre -- */
    folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirClosedIcon),
                          QIcon::Normal, QIcon::Off);
    folderIcon.addPixmap(style()->standardPixmap(QStyle::SP_DirOpenIcon),
                          QIcon::Normal, QIcon::On);
    fileIcon.addPixmap(style()->standardPixmap(QStyle::SP_FileLinkIcon));

    /* -- set root icon -- */
    root->setIcon(0, folderIcon);

    /* -- double clic sur un item -- */
    connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
            this, SLOT(openFileItem(QTreeWidgetItem *, int)));
}

  /*-----------------------*/
  /*    PRIVATE SLOTS      */
  /*-----------------------*/

void TreeFiles::openFileItem(QTreeWidgetItem *item, int column)
{

}

void TreeFiles::appendFolder(QTreeWidgetItem * parentFolder)
{

}
/*
TreeFiles::appendSourceFilesList(QList<Modules *> list, QTreeWidgetItem * parent)
{

}
*/
/*
void TreeFiles::loadTreeFilesProject(Project<Type> *project)
{

}
*/


